﻿
<%@ Page Language="C#" Theme="Default" MasterPageFile="~/MasterPages/admin.master" AutoEventWireup="true"  CodeFile="NhomKhachHangEdit.aspx.cs" Inherits="NhomKhachHangEdit" Title="NhomKhachHang Edit" %>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">Nhom Khach Hang - Add/Edit</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
		<data:MultiFormView ID="FormView1" DataKeyNames="NhomKhachHangId" runat="server" DataSourceID="NhomKhachHangDataSource">
		
			<EditItemTemplatePaths>
				<data:TemplatePath Path="~/Admin/UserControls/NhomKhachHangFields.ascx" />
			</EditItemTemplatePaths>
		
			<InsertItemTemplatePaths>
				<data:TemplatePath Path="~/Admin/UserControls/NhomKhachHangFields.ascx" />
			</InsertItemTemplatePaths>
		
			<EmptyDataTemplate>
				<b>NhomKhachHang not found!</b>
			</EmptyDataTemplate>
			
			<FooterTemplate>
				<asp:Button ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert" Text="Insert" />
				<asp:Button ID="UpdateButton" runat="server" CausesValidation="True" CommandName="Update" Text="Update" />
				<asp:Button ID="CancelButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel" />
			</FooterTemplate>

		</data:MultiFormView>
		
		<data:NhomKhachHangDataSource ID="NhomKhachHangDataSource" runat="server"
			SelectMethod="GetByNhomKhachHangId"
		>
			<Parameters>
				<asp:QueryStringParameter Name="NhomKhachHangId" QueryStringField="NhomKhachHangId" Type="String" />

			</Parameters>
		</data:NhomKhachHangDataSource>
		
		<br />

		<data:EntityGridView ID="GridViewChietKhau" runat="server"
			AutoGenerateColumns="False"					
			OnSelectedIndexChanged="GridViewChietKhau_SelectedIndexChanged"			 			 
			DataSourceID="ChietKhauDataSource"
			DataKeyNames="ChietKhauId"
			AllowMultiColumnSorting="false"
			DefaultSortColumnName="" 
			DefaultSortDirection="Ascending"	
			ExcelExportFileName="Export_ChietKhau.xls"  		
			Visible='<%# (FormView1.DefaultMode == FormViewMode.Insert) ? false : true %>'	
			>
			<Columns>
				<asp:CommandField ShowSelectButton="True" />
				<asp:BoundField DataField="StartDate" HeaderText="Start Date" SortExpression="StartDate" />				
				<asp:BoundField DataField="EndDate" HeaderText="End Date" SortExpression="EndDate" />				
				<asp:BoundField DataField="GhiChu" HeaderText="Ghi Chu" SortExpression="GhiChu" />				
				<asp:BoundField DataField="LastUpdate" HeaderText="Last Update" SortExpression="LastUpdate" />				
				<asp:BoundField DataField="UpdateBy" HeaderText="Update By" SortExpression="UpdateBy" />				
				<asp:BoundField DataField="Header" HeaderText="Header" SortExpression="Header" />				
			</Columns>
			<EmptyDataTemplate>
				<b>No Chiet Khau Found! </b>
				<asp:HyperLink runat="server" ID="hypChietKhau" NavigateUrl="~/admin/ChietKhauEdit.aspx">Add New</asp:HyperLink>
			</EmptyDataTemplate>
		</data:EntityGridView>					
		
		<data:ChietKhauDataSource ID="ChietKhauDataSource" runat="server" SelectMethod="Find">
		    <Parameters>
				<data:SqlParameter Name="Parameters">
					<Filters>
						<data:ChietKhauFilter  Column="NhomKhachHangId" QueryStringField="NhomKhachHangId" /> 
					</Filters>
				</data:SqlParameter>
				<data:CustomParameter Name="OrderByClause" Value="" ConvertEmptyStringToNull="false" /> 
		    </Parameters>
		</data:ChietKhauDataSource>		
		
		<br />
		

</asp:Content>

